binary '>>' : no operator defined which takes a right-hand operand of type ''
来源:百度知道 编辑:UC知道 时间:2024/06/10 15:37:50
该程序是做矩阵加法的,这错怎么改(我刚学指针)
#include<iostream>
using namespace std;
const int X=3;
const int Y=4;
void MP(int a[X][Y],int b[X][Y])
{
int i=0;int *m;int *n;
*m=a[0][0];
*n=b[0][0];
for(;i<X*Y;i++)
{
*m=(*m++)+(*n++);
}
}
int main(void)
{
int a[X][Y],b[X][Y];
for(int p=0;p<X;p++)
{
cout<<"|";
for(int q=0;q<Y;q++)
{
cout<<" ";
cin>>*(a+p)+q; //有错 no operator defined which takes a right-hand operand of type 'int *' (or there is no acceptable conversion)
}
cout<<" |"<<endl;
}
cout<<"结果为:"<<endl;
cout<<MP<<endl;
return 0;
}
#include<iostream>
using namespace std;
const int X=3;
const int Y=4;
void MP(int a[X][Y],int b[X][Y])
{
int i=0;int *m;int *n;
*m=a[0][0];
*n=b[0][0];
for(;i<X*Y;i++)
{
*m=(*m++)+(*n++);
}
}
int main(void)
{
int a[X][Y],b[X][Y];
for(int p=0;p<X;p++)
{
cout<<"|";
for(int q=0;q<Y;q++)
{
cout<<" ";
cin>>*(a+p)+q; //有错 no operator defined which takes a right-hand operand of type 'int *' (or there is no acceptable conversion)
}
cout<<" |"<<endl;
}
cout<<"结果为:"<<endl;
cout<<MP<<endl;
return 0;
}
cin>>*(a+p)+q;
改成cin>>*(*(a+p)+q);或者干脆就cin>>a[p][q];
cin>>*(a+p)+q; //有错 no operator defined which takes a right-hand operand of type 'int *' (or there is no acceptable conversion)
改成:
cin>>a[p][q];
什么是binary 命令??
Binary Search Trees test
It\'s the long-awaited film version of the Broadway hit. The message sent as a binary attachment
c++中的ios::binary是什么意思?
cannot execute binary file,why!?
php中的binary safe什么意思?
WINFLANSH 里面BIOS binary file check sum error是什么意思啊
计算机的二分法检索(binary-search)是什么?
linux下"cannot execute binary file"是怎么回事
MSSQLServer Binary类型字段 怎么用Delphi读取